using Godot;
using System;

public partial class Button : Godot.Button
{
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
		// 动态链接信号
		this.Connect("pressed",new Callable(this,"OnButtonPressed"));
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public override void _Process(double delta)
	{
	}

	public void OnButtonPressed()
	{
		GD.Print("Button pressed");
		Node2D node = GetNode<Node2D>("../Sprite2D");
		node.QueueFree();
	}
}
